﻿
<%@ Page Title="" Language="C#" MasterPageFile="../Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Topic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div id="replyTopic">
        <h2>
            消息主题：</h2>
        <div class="sec">
            <%= Html.SimpleUserLabel(Model.Sender) %>:<%= Model.MessageTitle%><span class="ignore">(发布于<%= Model.CreateOn %>)</span>
        </div>
        <div class="sec">
            <%= Model.MessageText%>
        </div>
        <div class="sec">
            消息参与者：
            <% foreach (var group in Model.Participator.GroupParticipators)
               {%>
            <%=Html.SimpleGroupLabel(group) %>
            <%}
               foreach (var user in Model.Participator.UserParticipators)
               {%>
            <%= Html.SimpleUserLabel(user) %>
            <%}
            %>(共<%= Model.Participator.AllUserMemebers.Count %>人)
        </div>
        <% if (Model.NeedConfirm)
           {%>s
        <div class="sec">
            <b>该消息需要确认。</b><br />
            已确认：<%= Model.ConfirmedCount %>人 <small>未确认：<%= Model.NoConfirmCount %>人</small>
            <a href="/message/confirm?topicId=<%= Model.MessageId %>">详细</a><br />
            <%} %>
            <% if (Model.HasConfirmed.HasValue)
               {
                   if (Model.HasConfirmed.GetValueOrDefault())
                   {%>
            <small>您已经确认了消息。</small><br />
            <%}
                   else
                   { %>
            <form method="post" action="/Message/ConfirmMessage?topicId=<%= Model.MessageId %>">
            <%= Html.Hidden("messageId", Model.MessageId.ToString()) %>
            <small>您还没有确认。</small><input class="button" type="submit" value="立刻确认" /><br />
            </form>
            <%}
               } %>
        </div>
        <div class="sec">
            <form method="post" action="/Message/ReplyTopic">
            <%= Html.Hidden("topicId", Model.MessageId.ToString()) %>
            <input class="input_b" name="replyText" value="回复 <%= Model.Sender.Name %> : " /><br />
            <input type="submit" value="回复" class="button" /><%= Html.CheckBox("isReplyToAll")%><label
                for="replyToAllGroup">回复所有参与者</label>
            </form>
        </div>
        <!-- 回复列表 -->
        <% if (Model.ReplyList != null && Model.ReplyList.Count > 0)
           {%>
        <div class="list">
            <%for (int index = 0; index < Model.ReplyList.Count; index++)
              { %>
            <div>
                <%= Html.SimpleUserLabel(Model.ReplyList[index].GetSenderInfo()) %>.&nbsp;<%= Model.ReplyList[index].MessageText %><p>
                    <span class="ignore">(<%= Model.ReplyList[index].CreateOn.ToShortDateTime() %>)</span>
                    <a href="ReplySingle?messageId=<%= Model.ReplyList[index].MessageId.ToString() %>">回复</a></p>
            </div>
            <%}// end of for
            %>
        </div>
        <%}// end of if %>
    </div>
</asp:Content>
